Skip to content

fix: use safeParseJson for POST /api/artists body parsing#117

Merged
sweetmantech merged 2 commits intotestfrom
fix/artists-safe-parse-json
Jan 15, 2026
Merged

fix: use safeParseJson for POST /api/artists body parsing#117
sweetmantech merged 2 commits intotestfrom
fix/artists-safe-parse-json

Conversation

@sweetmantech
Copy link
Contributor

Summary

  • Use shared safeParseJson utility for body parsing instead of raw request.json()
  • safeParseJson returns {} for empty/invalid JSON instead of throwing
  • Allows docs UI to work when no body is provided - schema validation catches missing fields

Test plan

  • All existing tests pass
  • Invalid JSON now returns "name is required" instead of "Invalid JSON body"

🤖 Generated with Claude Code

Use shared safeParseJson utility which returns {} for empty/invalid JSON
instead of throwing an error. This allows the docs UI to work when no
body is provided - the schema validation will catch missing required fields.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@vercel
Copy link
Contributor

vercel bot commented Jan 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
recoup-api Ready Ready Preview Jan 15, 2026 7:23pm

@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Zod 4.x deprecates z.string().uuid() in favor of z.uuid() directly.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@sweetmantech sweetmantech merged commit 7409482 into test Jan 15, 2026
4 checks passed
@sweetmantech sweetmantech deleted the fix/artists-safe-parse-json branch January 15, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant